load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tikv",
    srcs = ["tikv.go"],
    importpath = "github.com/pingcap/tidb/br/pkg/lightning/tikv",
    visibility = ["//visibility:public"],
    deps = [
        "//br/pkg/lightning/common",
        "//br/pkg/lightning/config",
        "//br/pkg/lightning/log",
        "//br/pkg/pdutil",
        "//br/pkg/version",
        "//parser/model",
        "@com_github_coreos_go_semver//semver",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_kvproto//pkg/debugpb",
        "@com_github_pingcap_kvproto//pkg/import_sstpb",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//status",
        "@org_golang_x_sync//errgroup",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tikv_test",
    timeout = "short",
    srcs = ["tikv_test.go"],
    flaky = True,
    shard_count = 4,
    deps = [
        ":tikv",
        "//br/pkg/lightning/common",
        "@com_github_coreos_go_semver//semver",
        "@com_github_pingcap_kvproto//pkg/import_sstpb",
        "@com_github_stretchr_testify//require",
    ],
)
